package com.qfedu.spring.springmvc.controller;


import com.qfedu.spring.springmvc.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

/**
 * @author zhang
 * @Title: commonValidateAdd
 * @date : 2022/5/3 9:52
 */
@Controller
@RequestMapping("/work")
@SessionAttributes("user") // 把Model 中的user复制放到session中
public class HomeWorkController {

    @RequestMapping("/test1")
    public String test1(User user, Model model){
        model.addAttribute(user);
        return "index3";
    }
}
